package com.bjsxt.userCenter.users.service.impl;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.bjsxt.userCenter.users.service.IOuterService;
import com.bjsxt.usercenter.common.util.ConstatFinalUtil;

@Service("outerService")
public class OuterServiceImpl implements IOuterService
{

	/**
	 * "data":{
				"token":""
			}
	 */
	@Override
	public JSONObject validatorAdmins01Service(JSONObject reqJSON)
	{
		JSONObject resultJSON = new JSONObject();
		JSONObject dataJSON =reqJSON.getJSONObject("data");
		String token =dataJSON.getString("token")+"";
		JSONObject adminsJSON =(JSONObject) ConstatFinalUtil.TOOKEN_MAP.get(token);
		if(adminsJSON!=null){
			dataJSON.put("admins", adminsJSON);
			resultJSON.put("data", dataJSON);
			resultJSON.put("version", reqJSON.getString("version"));
			resultJSON.put("code", "0");
			resultJSON.put("info", ConstatFinalUtil.INFO_JSON.get("0"));
		}else{
			resultJSON.put("code", "9");
			resultJSON.put("info", ConstatFinalUtil.INFO_JSON.get("9"));
		}
		return resultJSON;
	}

}
